The Universal Serial Bus (USB) is a serial interface standard developed to provide flexible interconnections between a host device and multiple USB functions. A USB function is contained within a device and provides a capability to the host, such as a digital microphone, speakers, a mouse, a keyboard, camera, game controller, flash drive or a network adapter. USB utilizes a master-slave architecture in which the USB host, as master, initiates all data transfers with USB functions, as slaves, both into and out of the host device. The USB architecture does not provide a mechanism for attached functions to arbitrate for use of the bus. Thus, the USB host is responsible for providing the arbitration service to attached functions. This is typically accomplished by polling the attached functions on a periodic schedule to determine whether each function has data to transfer to the host and subsequently scheduling the data transfer.
The USB architecture supports functional data and control exchange between the USB host and a USB device as a set of either uni-directional or bi-directional pipes. USB data transfers take place between host software and a particular endpoint on a USB device. Such associations between the host software and a USB device endpoint are called pipes.
The USB architecture provides four basic types of data transfers. Control transfers are used to configure a device at attach time and can be used for other device-specific purposes, including control of other pipes on the device or host access to control registers on the device. Bulk data transfers are utilized for variably sized and bursty transfers and have wide latitude in usage. Exemplary usage would be in devices that are used by a computer file system such as flash drives, thumb drives, or the other common names for mass storage USB interfaces. Interrupt data transfers are typically used for regularly scheduled delivery of data, for example, polling a USB mouse for movement or a USB keyboard for new input. Isochronous data transfers occupy a prenegotiated amount of USB bandwidth with a prenegotiated delivery latency. Isochronous data transfer are sometimes referred to as streaming real time transfers. Exemplary usage would be a USB base audio device which steadily receives audio to be played through the speakers and steadily transmits audio from a microphone. A single pipe supports only one of the types of transfers described above for any given device configuration.
One common application of USB is the use of a USB network adapter (Ethernet, WiFi, Phoneline, Powerline) for providing network connectivity to a personal computer via a USB port. Exemplary USB network adapters include the WUSB54GP Wireless-G Portable USB Adapter V4.0, the WUSB54GS Wireless-G USB Network Adapter with Speedbooster, and the WUSB54G Wireless-G USB Network Adapter V4.0, all from the Linksys division of Cisco Systems, Inc., of San Jose, Calif. However, typical USB network adapters can consume excessive bandwidth in the polling mechanism utilized for supporting packet reception. This polling mechanism involves the generation of continuous bulk-IN data transfers to poll for packet reception. For each bulk-IN data transfer process, the USB driver on the host generates a bulk-IN transfer descriptor and stores the transfer descriptor in queue. The USB host controller fetches the transfer descriptor from queue and transmits a bulk-IN token to the USB network adapter. This bulk-IN token describes the type and direction of data transfer (e.g., bulk-IN), the USB device address, and the endpoint number.
When the USB network adapter receives the bulk-IN token from the USB host, if no new network data has been received by the adapter, the adapter will respond to the bulk-IN token with a NAK handshake packet. The USB host will continuously transmit bulk-IN tokens to the USB network adapter until the USB network adapter receives network data, in which case the USB network adapter will respond to the bulk-IN token with a bulk data packet containing the network data.
Polling using the bulk-IN transfer enables reception of the data with minimal latency. However, the repeated generation of bulk-IN transfer descriptors by the USB host, even when no new network data has been received, can consume an excessive amount of host resources. In some cases, the continuous bulk-IN tokens and NAK responses may consume up to approximately 50% of the total USB bandwidth. The extra bandwidth consumed on the host side can measurably slow other transfers to/from other USB endpoints on the bus. In addition, the polling mechanism can consume transfer resources in the host computer for an indeterminate period of time. The overhead imposed by this polling mechanism decreases overall throughput on the USB bus and increases the chance that that other USB devices on the bus will operate inefficiently or even improperly.
Accordingly, there is a need for an interface providing improved data transfer between a host and a peripheral over a bus. It is desirable that the interface provide minimal data transfer latency, while not consuming an excessive amount of host resources.